﻿Public Class frmBaixaVaga

    Private vaga As New _VagaTrabalho
    Private mot As New _motivo

    Private IdVaga As Integer

    Private frmMot As New frmConsultaMotivo


    Private Sub frmBaixaVaga_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        txtDTBaixa.Text = Now.Date

    End Sub

    Public Sub New(ByVal pIdvagadeTrabalho As Integer)

        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        IdVaga = pIdvagadeTrabalho

        ' Add any initialization after the InitializeComponent() call.
    End Sub

    Private Sub btnConsultaMotivo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConsultaMotivo.Click
        frmMot = New frmConsultaMotivo
        frmMot.ShowDialog()
        txtIdMotivo.Text = frmMot.idMotivo
        txtDSMotivo.Text = frmMot.dsMotivo

    End Sub


    Private Sub btnEfetivaBaixa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEfetivaBaixa.Click

        vaga.efetuarBaixaVagaAberta(IdVaga, txtIdMotivo.Text, txtDTBaixa.Text)
        MsgBox("Vaga Baixada com sucesso")

    End Sub
End Class